package FileWork;

import java.io.File;
import java.io.FileFilter;

/*列出当前目录中所有名字包含s的子项,lambda写法
 */
public class Test06 {
    public static void main(String[] args) {
        File file = new File(".");
        if (file.isDirectory()){
            File[] subs = file.listFiles(pathname -> (pathname.getName().contains("s")));
            for (File sub:subs){
                System.out.println(sub.getName());
            }
        }
    }
}
